#include <iostream>

class vehicle {
public:
  virtual void display() { std::cout << "vehicle" << std::endl; }
};

class car : public vehicle {
public:
  void display() { std::cout << "car" << std::endl; }
};

class trunk : public vehicle {
public:
  void display() { std::cout << "trunk" << std::endl; }
};

class boat : public vehicle {
public:
  void display() { std::cout << "boat" << std::endl; }
};

int main() {
  car c;
  c.display();

  trunk t;
  t.display();

  boat b;
  b.display();

  vehicle *v = new vehicle;
  v->display();

  v = &c;
  v->display();

  v = &t;
  v->display();

  v = &b;
  v->display();
}